package best.driver.android.NetBase;

/**
 * Created by xiangxuefeng on 15/8/17.
 */
public class SocketHeader {

    private int crcCode = 0xabcd0100;// magic code + major version + minor veresion

    private int length;// header length + body length

    private byte type;// like: shake, heart beat, business logic

    private byte priority = 0;// TODO: should use '&0xff' to get unsigned number

    public int getCrcCode() {
        return crcCode;
    }

    public void setCrcCode(int crcCode) {
        this.crcCode = crcCode;
    }

    public int getLength() {
        return length;
    }

    public void setLength(int length) {
        this.length = length;
    }

    public byte getType() {
        return type;
    }

    public void setType(byte type) {
        this.type = type;
    }

    public byte getPriority() {
        return priority;
    }

    public void setPriority(byte priority) {
        this.priority = priority;
    }

    @Override
    public String toString() {
        return "SocketHeader [crcCode=" + crcCode + ", length=" + length + ", type=" + type
                + ", priority=" + priority + "]";
    }
}
